/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gestion;

import java.awt.Event;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.ActionMap;
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.JTable;
import javax.swing.KeyStroke;
import javax.swing.table.DefaultTableColumnModel;
import javax.swing.table.TableColumn;
import org.apache.log4j.Logger;
import impresos.DatosToImprimir;
import otros.Fecha;
import impresos.ImpCaja;
import impresos.ImpVenta;
import java.util.ArrayList;
import javax.swing.DefaultRowSorter;
import javax.swing.RowFilter;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
import otros.MiTableModel;
import otros.Util;
import tablasSql.ConsultaBD;
import tablasSql.FacturasAlbaranes;

/**
 *
 * @author FERRETERIA
 */
public class FVentas extends javax.swing.JInternalFrame {
    private final static Logger log = Logger.getLogger(FVentas.class);
    boolean fuera;
    int filaSel;
    
  
    public FVentas() {
        Util.setConfiguracionLog(Util.LOG4_FICH);
        initComponents();
        AnchoColumnas();
        tabla.setColumnSelectionAllowed(false);
        tabla.setAutoCreateRowSorter(true);
        String []fecha = new Fecha().getFecha().split("-");
        txtDia.setText(fecha[0]);
        txtMes.setText(fecha[1]);
        txtAño.setText(fecha[2]);
        
        ActionMap mapaAccion = this.getActionMap();
        InputMap map = this.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
        //negro
        KeyStroke ctrl_n = KeyStroke.getKeyStroke(KeyEvent.VK_N,Event.CTRL_MASK);
        map.put(ctrl_n , "ctrl_n");
        mapaAccion.put("ctrl_n",CTRL_N());
        chNegro.setVisible(false);
        bNegro.setVisible(false);
        //cajon
        KeyStroke cajon = KeyStroke.getKeyStroke(KeyEvent.VK_F4,0);
        map.put(cajon , "cajon");
        mapaAccion.put("cajon",F4());
        
        ActualizarTabla();
    }
    
    public AbstractAction CTRL_N(){
        return new AbstractAction() { 
                    public void actionPerformed(ActionEvent e) {
                            chNegro.setVisible(!chNegro.isVisible());
                            if (!chNegro.isVisible()) {
                                chNegro.setSelected(false);
                                ActualizarTabla();
                            }
                    } 
                };
    }
    
    public AbstractAction F4(){
        return new AbstractAction() { 
                    public void actionPerformed(ActionEvent e) {ImpVenta.abrirCajon();} 
                };
    }
    
    private void AnchoColumnas() {
        DefaultTableColumnModel colModel = (DefaultTableColumnModel)tabla.getColumnModel();
        TableColumn col = colModel.getColumn(0);        
        col.setPreferredWidth(100);
        col = colModel.getColumn(1);
        col.setPreferredWidth(320);    
        if (chNegro.isSelected()) {
            colModel.getColumn(3).setPreferredWidth(100);
            colModel.getColumn(7).setPreferredWidth(25);
        }
    }
    
    private void ActualizarTabla() {                    
        int dia = Integer.parseInt(txtDia.getText().isEmpty()? "0" : txtDia.getText());
        int mes = Integer.parseInt(txtMes.getText().isEmpty()? "0" : txtMes.getText());
        int año = Integer.parseInt(txtAño.getText().isEmpty()? "0" : txtAño.getText());
        
        MiTableModel datos = FacturasAlbaranes.getTablaCaja(chNegro.isSelected(), dia, mes, año);
        tabla.setModel(datos);
        if (!chNegro.isSelected()) {
            TableRowSorter<TableModel> sinNegro = new TableRowSorter<TableModel>(datos);
            tabla.setRowSorter(sinNegro);
            //sinNegro.setRowFilter(RowFilter.numberFilter(RowFilter.ComparisonType.NOT_EQUAL, -0f, 2));
        }
        
        tabla.getColumnModel().getColumn(0).setCellRenderer(new tableCellRender.Id(filaSel, fuera));
        tabla.getColumnModel().getColumn(1).setCellRenderer(new tableCellRender.Texto(filaSel, fuera));
        tabla.getColumnModel().getColumn(2).setCellRenderer(new tableCellRender.Precio(filaSel, fuera));
        tabla.getColumnModel().getColumn(3).setCellRenderer(new tableCellRender.TipoPago(filaSel, fuera));
        tabla.getColumnModel().getColumn(4).setCellRenderer(new tableCellRender.Turno(filaSel, fuera));
        tabla.getColumnModel().getColumn(5).setCellRenderer(new tableCellRender.Vendedor(filaSel, fuera));
        AnchoColumnas();
        
        
        lblNegro.setVisible(chNegro.isSelected());
        txtNegro.setVisible(chNegro.isSelected());
        bNegro.setVisible(chNegro.isSelected());
        txtNumMañanaN.setVisible(chNegro.isSelected());
        txtNumTardeN.setVisible(chNegro.isSelected());
        
        txtNumReg.setText(""+tabla.getRowCount());
        HallarTotal();
    }
    private float tNegro = 0;
    
    private void HallarTotal() {
        float total = 0;
        float tEfectivo = 0;
        float tCheque = 0;
        float tTrans = 0;
        float tTarjeta = 0;
        float tVale = 0;
        float tMañana = 0;
        float tTarde = 0;
        float t1 = 0;
        float t2 = 0;
        float t3 = 0;
        float t4 = 0;
        int numTarde = 0;
        int numMañana = 0; 
        int numMañanaN = 0;
        int numTardeN = 0;
        
        tNegro = 0;
        for(int i = 0; i < tabla.getRowCount(); i++) {
            try {
                float valor = Float.parseFloat(tabla.getValueAt(i, 2).toString());
                //--------------------------------------------------------- tipo
                switch (Integer.parseInt(""+tabla.getValueAt(i, 3))) {
                    case 10:
                    case 0: tEfectivo += valor;
                            total += valor;
                        break;
                    case 11:
                    case 1: tTarjeta += valor;
                            total += valor;
                        break;
                    case 12:
                    case 2: tCheque += valor;
                            total += valor;
                        break;
                    case 13:
                    case 3: tTrans += valor;
                            total += valor;
                        break;
                    case 14:
                    case 4: tVale += valor;
                        break;
                        
                }
                //---------------------------------------------------------turno
                if (Float.parseFloat(tabla.getValueAt(i, 4).toString()) > 14)
                    tTarde += valor;
                else
                    tMañana += valor;
                //------------------------------------------------------vendedor
                switch (Integer.parseInt(""+tabla.getValueAt(i, 5))) {
                    case 0:
                        t1 += valor;
                        break;
                    case 1:
                        t2 += valor;
                        break;
                    case 2:
                        t3 += valor;
                        break;
                    case 3:
                        t4 += valor;
                        break;
                }
                //-------------------------------------------------------- negro
                if (chNegro.isSelected()) {
                    float negro = Float.parseFloat(tabla.getValueAt(i, 6).toString());
                    tNegro += negro;
                    if (negro > 0f)
                        tabla.setValueAt(true, i, 7);       
                    //------------------------------------------------------- num ventas
                    if (Float.parseFloat(""+tabla.getValueAt(i, 4)) > 15) {
                        if(negro > 0)
                            numTardeN++;
                        else
                            numTarde++;
                    }
                    else {
                        if(negro > 0)
                           numMañanaN++;
                        else
                           numMañana++;
                    }
                }
                else {
                    if (Float.parseFloat(""+tabla.getValueAt(i, 4)) > 15) 
                        numTarde++;
                    else 
                        numMañana++;
                }
           } catch(Exception ex) {
                log.warn("HallarTotal: " + ex);
            }
        }
        txtTotal.setText(Util.getFormatPrecio(total,2));
        txtEfectivo.setText(Util.getFormatPrecio(tEfectivo,2));
        txtCheque.setText(Util.getFormatPrecio(tCheque,2));
        txtTarjeta.setText(Util.getFormatPrecio(tTarjeta,2));
        txtTrans.setText(Util.getFormatPrecio(tTrans,2));
        txtVale.setText(Util.getFormatPrecio(tVale,2));
        txtMañana.setText(Util.getFormatPrecio(tMañana,2));
        txtTarde.setText(Util.getFormatPrecio(tTarde,2));
        txtVen1.setText(Util.getFormatPrecio(t1, 2));
        txtVen2.setText(Util.getFormatPrecio(t2, 2));
        txtVen3.setText(Util.getFormatPrecio(t3, 2));
        txtVen4.setText(Util.getFormatPrecio(t4, 2));
        if (chNegro.isSelected()) {
            txtNegro.setText(Util.getFormatPrecio(tNegro,2));
        }
        txtNumMañana.setText(""+numMañana);
        txtNumTarde.setText(""+numTarde);
        txtNumMañanaN.setText(""+numMañanaN);
        txtNumTardeN.setText(""+numTardeN);
    }
    
    private DatosToImprimir getDatosToImprimir() {
        DatosToImprimir d = new DatosToImprimir();
        d.setFecha(txtDia.getText()+"/"+txtMes.getText()+"/"+txtAño.getText());
        
        float totales [] = {Float.parseFloat(txtTotal.getText().replace(",",".").replace("€", "").trim()),
                            Float.parseFloat(txtEfectivo.getText().replace(",",".").replace("€", "").trim()),
                            Float.parseFloat(txtTarjeta.getText().replace(",",".").replace("€", "").trim()),
                            Float.parseFloat(txtCheque.getText().replace(",",".").replace("€", "").trim()),
                            Float.parseFloat(txtTrans.getText().replace(",",".").replace("€", "").trim()),
                            Float.parseFloat(txtVale.getText().replace(",",".").replace("€", "").trim()),
                            Float.parseFloat(txtMañana.getText().replace(",",".").replace("€", "").trim()),
                            Float.parseFloat(txtTarde.getText().replace(",",".").replace("€", "").trim())
                           };
        d.setTotales(totales);
        d.setNumPagos(contarTiposPagos());
        return d;
    }
    
    private int [] contarTiposPagos () {
        int numE = 0;
        int numTa = 0;
        int numTr = 0;
        int numC = 0;
        int numV = 0;
        int numMañana = Integer.parseInt(txtNumMañana.getText());
        int numTarde = Integer.parseInt(txtNumTarde.getText());
        for (int i = 0; i < tabla.getRowCount(); i++) {
            switch (Integer.parseInt(""+tabla.getValueAt(i, 3))) {
                case 0: numE++;
                    break;
                case 1: numTa++;
                    break;
                case 2: numC++;
                    break;
                case 3: numTr++;
                    break;
                case 4: numV++;
                    break;
            }
        }
        
        int valor [] = {numE, numTa, numC, numTr, numV, numMañana, numTarde};
        return valor;
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jScrollPane1 = new javax.swing.JScrollPane();
        tabla = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        txtDia = new javax.swing.JFormattedTextField();
        jLabel3 = new javax.swing.JLabel();
        txtMes = new javax.swing.JFormattedTextField();
        bBuscar = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        txtAño = new javax.swing.JFormattedTextField();
        chNegro = new javax.swing.JCheckBox();
        bNegro = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        txtTotal = new javax.swing.JTextField();
        txtEfectivo = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        txtTarjeta = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        txtCheque = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        txtTrans = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        txtNegro = new javax.swing.JTextField();
        lblNegro = new javax.swing.JLabel();
        txtVale = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        txtMañana = new javax.swing.JTextField();
        lblMañana = new javax.swing.JLabel();
        lblTarde = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        txtVen4 = new javax.swing.JTextField();
        lblMañana1 = new javax.swing.JLabel();
        txtVen1 = new javax.swing.JTextField();
        lblMañana2 = new javax.swing.JLabel();
        txtVen2 = new javax.swing.JTextField();
        lblMañana3 = new javax.swing.JLabel();
        txtVen3 = new javax.swing.JTextField();
        lblMañana4 = new javax.swing.JLabel();
        txtTarde = new javax.swing.JTextField();
        bTicket = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        txtNumReg = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        txtNumMañana = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        txtNumTarde = new javax.swing.JTextField();
        txtNumMañanaN = new javax.swing.JTextField();
        txtNumTardeN = new javax.swing.JTextField();

        setClosable(true);
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Visualizar Ventas");
        setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/img/icono2.png"))); // NOI18N
        getContentPane().setLayout(new java.awt.GridBagLayout());

        jScrollPane1.setMinimumSize(new java.awt.Dimension(250, 250));
        jScrollPane1.setPreferredSize(new java.awt.Dimension(250, 250));

        tabla.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID", "Cliente", "Total", "Fecha"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabla.setColumnSelectionAllowed(true);
        tabla.getTableHeader().setReorderingAllowed(false);
        tabla.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tablaMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                tablaMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                tablaMouseExited(evt);
            }
        });
        tabla.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                tablaMouseMoved(evt);
            }
        });
        jScrollPane1.setViewportView(tabla);
        tabla.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        if (tabla.getColumnModel().getColumnCount() > 0) {
            tabla.getColumnModel().getColumn(0).setResizable(false);
            tabla.getColumnModel().getColumn(1).setResizable(false);
            tabla.getColumnModel().getColumn(2).setResizable(false);
            tabla.getColumnModel().getColumn(3).setResizable(false);
        }

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 10);
        getContentPane().add(jScrollPane1, gridBagConstraints);

        jPanel1.setMinimumSize(new java.awt.Dimension(300, 70));
        jPanel1.setPreferredSize(new java.awt.Dimension(300, 70));
        jPanel1.setLayout(new java.awt.GridBagLayout());

        jLabel1.setText("Criterios de busqueda:   ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10);
        jPanel1.add(jLabel1, gridBagConstraints);

        jLabel2.setText("Dia");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(jLabel2, gridBagConstraints);

        txtDia.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("00"))));
        txtDia.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtDia.setMinimumSize(new java.awt.Dimension(25, 20));
        txtDia.setPreferredSize(new java.awt.Dimension(25, 20));
        txtDia.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txtDiaMouseClicked(evt);
            }
        });
        txtDia.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtDiaKeyPressed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 25, 0, 0);
        jPanel1.add(txtDia, gridBagConstraints);

        jLabel3.setText("Mes");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 29);
        jPanel1.add(jLabel3, gridBagConstraints);

        txtMes.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("00"))));
        txtMes.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtMes.setMinimumSize(new java.awt.Dimension(25, 20));
        txtMes.setPreferredSize(new java.awt.Dimension(25, 20));
        txtMes.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txtMesMouseClicked(evt);
            }
        });
        txtMes.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtMesKeyPressed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 80, 0, 0);
        jPanel1.add(txtMes, gridBagConstraints);

        bBuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/buscar.png"))); // NOI18N
        bBuscar.setMinimumSize(new java.awt.Dimension(61, 61));
        bBuscar.setPreferredSize(new java.awt.Dimension(61, 61));
        bBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bBuscarActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 3;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(bBuscar, gridBagConstraints);

        jLabel4.setText("Año");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 29);
        jPanel1.add(jLabel4, gridBagConstraints);

        txtAño.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("0000"))));
        txtAño.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtAño.setToolTipText("yyyy");
        txtAño.setMinimumSize(new java.awt.Dimension(25, 20));
        txtAño.setPreferredSize(new java.awt.Dimension(35, 20));
        txtAño.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txtAñoMouseClicked(evt);
            }
        });
        txtAño.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txtAñoKeyPressed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 30, 0, 0);
        jPanel1.add(txtAño, gridBagConstraints);

        chNegro.setText("Negro");
        chNegro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chNegroActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 6;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(chNegro, gridBagConstraints);

        bNegro.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/negro.png"))); // NOI18N
        bNegro.setMinimumSize(new java.awt.Dimension(61, 61));
        bNegro.setPreferredSize(new java.awt.Dimension(61, 61));
        bNegro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bNegroActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 7;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 3;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel1.add(bNegro, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.ipadx = 175;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 10, 0, 10);
        getContentPane().add(jPanel1, gridBagConstraints);

        jPanel2.setMinimumSize(new java.awt.Dimension(550, 90));
        jPanel2.setPreferredSize(new java.awt.Dimension(550, 90));
        jPanel2.setLayout(new java.awt.GridBagLayout());

        jLabel5.setText("Total");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 0;
        jPanel2.add(jLabel5, gridBagConstraints);

        txtTotal.setEditable(false);
        txtTotal.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtTotal.setMinimumSize(new java.awt.Dimension(100, 20));
        txtTotal.setPreferredSize(new java.awt.Dimension(100, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 1;
        jPanel2.add(txtTotal, gridBagConstraints);

        txtEfectivo.setEditable(false);
        txtEfectivo.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtEfectivo.setMinimumSize(new java.awt.Dimension(100, 20));
        txtEfectivo.setPreferredSize(new java.awt.Dimension(100, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(txtEfectivo, gridBagConstraints);

        jLabel6.setText("Efectivo");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(jLabel6, gridBagConstraints);

        txtTarjeta.setEditable(false);
        txtTarjeta.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtTarjeta.setMinimumSize(new java.awt.Dimension(75, 20));
        txtTarjeta.setPreferredSize(new java.awt.Dimension(75, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(txtTarjeta, gridBagConstraints);

        jLabel7.setText("Tarjeta");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(jLabel7, gridBagConstraints);

        txtCheque.setEditable(false);
        txtCheque.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtCheque.setMinimumSize(new java.awt.Dimension(75, 20));
        txtCheque.setPreferredSize(new java.awt.Dimension(75, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 6;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(txtCheque, gridBagConstraints);

        jLabel8.setText("Cheque");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 6;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(jLabel8, gridBagConstraints);

        txtTrans.setEditable(false);
        txtTrans.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtTrans.setMinimumSize(new java.awt.Dimension(75, 20));
        txtTrans.setPreferredSize(new java.awt.Dimension(75, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 7;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(txtTrans, gridBagConstraints);

        jLabel9.setText("Transferencia");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 7;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(jLabel9, gridBagConstraints);

        txtNegro.setEditable(false);
        txtNegro.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtNegro.setMinimumSize(new java.awt.Dimension(75, 20));
        txtNegro.setPreferredSize(new java.awt.Dimension(75, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 6;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(txtNegro, gridBagConstraints);

        lblNegro.setText("Negro");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 6;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 0, 0);
        jPanel2.add(lblNegro, gridBagConstraints);

        txtVale.setEditable(false);
        txtVale.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVale.setMinimumSize(new java.awt.Dimension(75, 20));
        txtVale.setPreferredSize(new java.awt.Dimension(75, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 8;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(txtVale, gridBagConstraints);

        jLabel11.setText("Vale");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 8;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(jLabel11, gridBagConstraints);

        txtMañana.setEditable(false);
        txtMañana.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtMañana.setMinimumSize(new java.awt.Dimension(75, 20));
        txtMañana.setPreferredSize(new java.awt.Dimension(75, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 7;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(txtMañana, gridBagConstraints);

        lblMañana.setText("Mañana");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 7;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 0, 0);
        jPanel2.add(lblMañana, gridBagConstraints);

        lblTarde.setText("Tarde");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 8;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 0, 0);
        jPanel2.add(lblTarde, gridBagConstraints);

        jPanel3.setMinimumSize(new java.awt.Dimension(100, 100));
        jPanel3.setLayout(new java.awt.GridBagLayout());

        txtVen4.setEditable(false);
        txtVen4.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVen4.setMinimumSize(new java.awt.Dimension(75, 20));
        txtVen4.setPreferredSize(new java.awt.Dimension(75, 20));
        txtVen4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtVen4ActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 0);
        jPanel3.add(txtVen4, gridBagConstraints);

        lblMañana1.setText("Juan");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 0, 0);
        jPanel3.add(lblMañana1, gridBagConstraints);

        txtVen1.setEditable(false);
        txtVen1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVen1.setMinimumSize(new java.awt.Dimension(75, 20));
        txtVen1.setPreferredSize(new java.awt.Dimension(75, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 0);
        jPanel3.add(txtVen1, gridBagConstraints);

        lblMañana2.setText("Ale");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 0, 0);
        jPanel3.add(lblMañana2, gridBagConstraints);

        txtVen2.setEditable(false);
        txtVen2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVen2.setMinimumSize(new java.awt.Dimension(75, 20));
        txtVen2.setPreferredSize(new java.awt.Dimension(75, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 0);
        jPanel3.add(txtVen2, gridBagConstraints);

        lblMañana3.setText("Onan");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 0, 0);
        jPanel3.add(lblMañana3, gridBagConstraints);

        txtVen3.setEditable(false);
        txtVen3.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVen3.setMinimumSize(new java.awt.Dimension(75, 20));
        txtVen3.setPreferredSize(new java.awt.Dimension(75, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 0);
        jPanel3.add(txtVen3, gridBagConstraints);

        lblMañana4.setText("Tino");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 0, 0);
        jPanel3.add(lblMañana4, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.gridheight = 2;
        jPanel2.add(jPanel3, gridBagConstraints);

        txtTarde.setEditable(false);
        txtTarde.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtTarde.setMinimumSize(new java.awt.Dimension(75, 20));
        txtTarde.setPreferredSize(new java.awt.Dimension(75, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 8;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        jPanel2.add(txtTarde, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 0);
        getContentPane().add(jPanel2, gridBagConstraints);

        bTicket.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/TICKET3.png"))); // NOI18N
        bTicket.setMaximumSize(new java.awt.Dimension(60, 60));
        bTicket.setMinimumSize(new java.awt.Dimension(55, 55));
        bTicket.setPreferredSize(new java.awt.Dimension(55, 55));
        bTicket.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bTicketActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 10, 10);
        getContentPane().add(bTicket, gridBagConstraints);

        jPanel4.setMinimumSize(new java.awt.Dimension(140, 70));
        jPanel4.setPreferredSize(new java.awt.Dimension(140, 70));
        jPanel4.setLayout(new java.awt.GridBagLayout());

        jLabel10.setText("Total");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0);
        jPanel4.add(jLabel10, gridBagConstraints);

        txtNumReg.setEditable(false);
        txtNumReg.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtNumReg.setMinimumSize(new java.awt.Dimension(40, 20));
        txtNumReg.setPreferredSize(new java.awt.Dimension(40, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 3);
        jPanel4.add(txtNumReg, gridBagConstraints);

        jLabel12.setText("Mañana");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
        jPanel4.add(jLabel12, gridBagConstraints);

        txtNumMañana.setEditable(false);
        txtNumMañana.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtNumMañana.setMinimumSize(new java.awt.Dimension(40, 20));
        txtNumMañana.setPreferredSize(new java.awt.Dimension(40, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        jPanel4.add(txtNumMañana, gridBagConstraints);

        jLabel13.setText("Tarde");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0);
        jPanel4.add(jLabel13, gridBagConstraints);

        txtNumTarde.setEditable(false);
        txtNumTarde.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtNumTarde.setMinimumSize(new java.awt.Dimension(40, 20));
        txtNumTarde.setPreferredSize(new java.awt.Dimension(40, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 3);
        jPanel4.add(txtNumTarde, gridBagConstraints);

        txtNumMañanaN.setEditable(false);
        txtNumMañanaN.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtNumMañanaN.setMinimumSize(new java.awt.Dimension(25, 20));
        txtNumMañanaN.setPreferredSize(new java.awt.Dimension(25, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        jPanel4.add(txtNumMañanaN, gridBagConstraints);

        txtNumTardeN.setEditable(false);
        txtNumTardeN.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtNumTardeN.setMinimumSize(new java.awt.Dimension(25, 20));
        txtNumTardeN.setPreferredSize(new java.awt.Dimension(25, 20));
        txtNumTardeN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtNumTardeNActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 3);
        jPanel4.add(txtNumTardeN, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 10);
        getContentPane().add(jPanel4, gridBagConstraints);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void tablaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaMouseClicked
       int fila = tabla.rowAtPoint(evt.getPoint());
       int colum = tabla.columnAtPoint(evt.getPoint());
       if (evt.isMetaDown()) { //getClickCount() == 2) {
            FTPV tpv = new FTPV();
            this.getParent().add(tpv);
            Principal.centrarFrame(tpv);
            tpv.show();
            int tipoTabla = Integer.parseInt(""+tabla.getValueAt(fila, 3))> 9? 1:0;
            tpv.cargar(tabla.getValueAt(fila, 0).toString(), tipoTabla);
       }
       // negro esta seleccionado
       if (colum == 7) {  
          // efectivo
          if (tabla.getValueAt(fila,3).toString().equals("0") ||
             tabla.getValueAt(fila,3).toString().equals("10")) {  // 
             if(Boolean.parseBoolean(""+tabla.getValueAt(fila, colum))) {
                // cantidad de la factura
                tNegro += Float.parseFloat(""+tabla.getValueAt(fila, 2));
             }
             else
                // cantidad en negro
                tNegro -= Float.parseFloat(""+tabla.getValueAt(fila, 2));
        
          }
          else
              tabla.setValueAt(false, fila, colum);
          txtNegro.setText(Util.getFormatPrecio(tNegro, 2));
       }

    }//GEN-LAST:event_tablaMouseClicked

    private void tablaMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaMouseExited
        fuera = true;
    }//GEN-LAST:event_tablaMouseExited

    private void tablaMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaMouseEntered
        fuera = false;
    }//GEN-LAST:event_tablaMouseEntered

    private void tablaMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaMouseMoved
        JTable aTable =  (JTable)evt.getSource();
        if (!fuera) {
            filaSel = aTable.rowAtPoint(evt.getPoint());
        }
    }//GEN-LAST:event_tablaMouseMoved

    private void bBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bBuscarActionPerformed
        ActualizarTabla();
    }//GEN-LAST:event_bBuscarActionPerformed

    private void txtDiaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtDiaMouseClicked
        txtDia.selectAll();
    }//GEN-LAST:event_txtDiaMouseClicked

    private void txtMesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtMesMouseClicked
        txtMes.selectAll();
    }//GEN-LAST:event_txtMesMouseClicked

    private void txtAñoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtAñoMouseClicked
        txtAño.selectAll();
    }//GEN-LAST:event_txtAñoMouseClicked

    private void bTicketActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bTicketActionPerformed
        ImpCaja.imprime(getDatosToImprimir());
        ImpVenta.abrirCajon();       
    }//GEN-LAST:event_bTicketActionPerformed

    private void chNegroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chNegroActionPerformed
        ActualizarTabla();
    }//GEN-LAST:event_chNegroActionPerformed

    private void txtDiaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtDiaKeyPressed
        if(evt.getKeyCode()==10){
            ActualizarTabla();
        }
    }//GEN-LAST:event_txtDiaKeyPressed

    private void txtMesKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMesKeyPressed
        if(evt.getKeyCode()==10){
            ActualizarTabla();
        }
    }//GEN-LAST:event_txtMesKeyPressed

    private void txtAñoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtAñoKeyPressed
        if(evt.getKeyCode()==10){
            ActualizarTabla();
        }
    }//GEN-LAST:event_txtAñoKeyPressed

    private void bNegroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bNegroActionPerformed
        ConsultaBD.cursorEspera(this);
        for (int i = 0; i < tabla.getRowCount(); i++) {
            String id = tabla.getValueAt(i, 0).toString().substring(5);
            String ano = tabla.getValueAt(i, 0).toString().substring(0, 4);
            String tablaSql = tabla.getValueAt(i, 3).toString().equals("0")? 
                            FacturasAlbaranes.TFACTURA: FacturasAlbaranes.TALBARANES;
            // paso a negro
            if (Boolean.parseBoolean(""+tabla.getValueAt(i, 7)) && 
                    tabla.getValueAt(i, 6).toString().equals("0.0") ) {
                FacturasAlbaranes.ConvertirNegro(tablaSql, ano, id,
                                    Float.parseFloat(""+tabla.getValueAt(i, 2)));
            } else  // quito de negro
               if (!Boolean.parseBoolean(""+tabla.getValueAt(i, 7)) && 
                    !tabla.getValueAt(i, 6).toString().equals("0.0") ) {
                  FacturasAlbaranes.ConvertirNegro(tablaSql,ano, id, 0f); 
            }
        }
        ConsultaBD.cursorNormal(this);
        ActualizarTabla();
    }//GEN-LAST:event_bNegroActionPerformed

    private void txtVen4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtVen4ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtVen4ActionPerformed

    private void txtNumTardeNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNumTardeNActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtNumTardeNActionPerformed

         
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bBuscar;
    private javax.swing.JButton bNegro;
    private javax.swing.JButton bTicket;
    private javax.swing.JCheckBox chNegro;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblMañana;
    private javax.swing.JLabel lblMañana1;
    private javax.swing.JLabel lblMañana2;
    private javax.swing.JLabel lblMañana3;
    private javax.swing.JLabel lblMañana4;
    private javax.swing.JLabel lblNegro;
    private javax.swing.JLabel lblTarde;
    private javax.swing.JTable tabla;
    private javax.swing.JFormattedTextField txtAño;
    private javax.swing.JTextField txtCheque;
    private javax.swing.JFormattedTextField txtDia;
    private javax.swing.JTextField txtEfectivo;
    private javax.swing.JTextField txtMañana;
    private javax.swing.JFormattedTextField txtMes;
    private javax.swing.JTextField txtNegro;
    private javax.swing.JTextField txtNumMañana;
    private javax.swing.JTextField txtNumMañanaN;
    private javax.swing.JTextField txtNumReg;
    private javax.swing.JTextField txtNumTarde;
    private javax.swing.JTextField txtNumTardeN;
    private javax.swing.JTextField txtTarde;
    private javax.swing.JTextField txtTarjeta;
    private javax.swing.JTextField txtTotal;
    private javax.swing.JTextField txtTrans;
    private javax.swing.JTextField txtVale;
    private javax.swing.JTextField txtVen1;
    private javax.swing.JTextField txtVen2;
    private javax.swing.JTextField txtVen3;
    private javax.swing.JTextField txtVen4;
    // End of variables declaration//GEN-END:variables
}
